home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
docs
/
mod2src
/
arrays.mod
< prev
next >
Wrap
Text File
|
1987-02-08
|
792b
|
26 lines
(* Chapter 6 - Program 1 *)
MODULE Arrays;
FROM InOut IMPORT WriteString, WriteCard, WriteLn;
VAR Index : CARDINAL;
Automobiles : ARRAY [1..12] OF CARDINAL;
BEGIN (* main program *)
FOR Index := 1 TO 12 DO
Automobiles[Index] := Index + 10;
END;
Automobiles[7] := 54; (* example, change one value of array *)
WriteString("This is the first program with an array.");
WriteLn;
WriteLn; (* end of data initialization *)
FOR Index := 1 TO 12 DO (* display the data now *)
WriteString("Automobile number");
WriteCard(Index,3);
WriteString(" has the value of");
WriteCard(Automobiles[Index],3);
WriteLn;
END;
END Arrays.